package com.example.demo.mingling;

public class Client {

    public static void main(String[] args) {
        //创建电灯的对象
        LightReceiver lightReceiver=new LightReceiver();
        //创建电灯的相关的开关命令
        LightOnComand lightOnComand = new LightOnComand(lightReceiver);
        LightoffComand lightoffComand = new LightoffComand(lightReceiver);
        //需要一个遥控器
        RemoteController remoteController=new RemoteController();

        //给我们的遥控器设置命令
        remoteController.setComand(0,lightOnComand,lightoffComand);

        System.out.println("按下等的开的按钮");
        remoteController.onButtonWasPushed(0);
        System.out.println("按下等关的按钮");
        remoteController.offButtonWasPushed(0);
    }
}
